import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

CustomHeader wkLoadHeader() {
  return CustomHeader(builder: (BuildContext context, RefreshStatus? mode) {
    Widget body = Container(
      width: 60,
      height: 60,
      child: Lottie.asset('assets/loading.json'),
    );
    if (mode == RefreshStatus.idle) {
      body = Text("下拉刷新");
    } else if (mode == RefreshStatus.refreshing) {
    } else if (mode == RefreshStatus.canRefresh) {
    } else if (mode == RefreshStatus.completed) {
      body = Text("刷新成功，耶～️");
    } else {
      body = Text("");
    }
    return Container(
      height: 55.0,
      child: Center(child: body),
    );
  });
}
